package com.quasar.hpatient.presenter;

import com.quasar.hpatient.model.httpmodel.AnotherResult;
import com.quasar.hpatient.model.medicalmodel.FriendsData;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.view.friends.FriendsListActivity;

/**
 * author : 许建宏
 * Date: 2017/10/21 0021
 * View:好友列表
 */

public class FriendsListPresenter {

    private RequestModel requestModel;
    private FriendsListActivity friendsListActivity;

    public FriendsListPresenter(FriendsListActivity friendsListActivity) {
        this.requestModel = new RequestModel();
        this.friendsListActivity = friendsListActivity;
    }

    public void PostFriendsList(String page){

        requestModel.PostFriendsList(page,new AnotherResultListener<AnotherResult<FriendsData>>() {
            @Override
            public void onSuccess(AnotherResult<FriendsData> data) {
                friendsListActivity.onSuccess(data);
            }

            @Override
            public void onError(String msg) {
                friendsListActivity.onError(msg);
            }

            @Override
            public void onRefreshUI() {
                friendsListActivity.onRefreshUI();
            }
        });
    }
}
